Activity Diagram for Facebook

Create some activity diagrams for the Facebook problem.

Activity diagrams are a great way to visualize the flow of messages from one activity to the other in the system. There can be different activity diagrams that we can create for Facebook. In this lesson, we will create activity diagrams for the following two activities:

  • Creating a new post

  • Activity challenge: A user joins a group.

Creating a new post#

The states and actions that will be involved in this activity diagram are provided below.

States#

Initial state: The user selects the new post option.

Final state: The post is published.

Actions#

The user selects the new post option, selects the privacy option, adds any attachments, and publishes the post.

The activity diagram for a user creating a new post
The activity diagram for a user creating a new post

Activity challenge: A user joins a group#

You’ll help us create an activity diagram of a user joining a group.A skeleton of the activity diagram is given below:

The activity diagram for a user joining the group
The activity diagram for a user joining the group

Notice that the actions in the diagram above are numbered from 1 to 11. The slots below represent the activities, and the arrows represent the flow from one activity to the other.

Can you rearrange the slots below in the correct order they should appear in the activity diagram given above?

Note: If you get stuck, just click the “Show Solution” button to check the correct answer.

Fill the missing slots with the correct actions for a user joining the group.

User searches for a group

User opens the group

User presses the “Join group” button

Privacy type

Private

User is asked to fill required information

Public

Request to join the group is generated

Request accepted?

User is rejected from the group

User successfully joins the group


Alternatively, you can click the "Show complete diagram" button below to see the complete activity diagram.

We've looked at some of the activity diagrams of Facebook. In the next lesson, we will present the code for our designed classes in some of the most popular languages.

Sequence Diagram for Facebook

Code for Facebook